const { resolve } = require("path");
module.exports = {
    publicPath: process.env.NODE_ENV === "production" ? "././" : "",
    //设置开发者工具的端口号,不设置则默认为8080端口
    productionSourceMap: false,
    devServer: {
        open: true,
        port: 8923,
    },
    parallel: 8,
    chainWebpack: (config) => {
        // 移除 prefetch 插件
        config.plugins.delete("prefetch");
        config.plugins.delete("preload");
    },
    configureWebpack: {
        resolve: {
            alias: {
                "@": resolve("src"),
            },
        },
        externals: {
            // key 不需要打包的模块名 value: 导出的全局变量名
        },
    },
};
